import java.util.List;
import java.util.ArrayList;
import java.util.Random;
import static java.util.Collections.shuffle;
public class zuoye {
 }
/* 输入两个链表，找出它们的第一个公共结点。
public class Solution {
 public ListNode getIntersectionNode(ListNode headA, ListNode headB) {
  ListNode pl=headA;
  ListNode ps=headB;
  int lenA=0;
  int lenB=0;
  while(pl!=null){
   lenA++;
   pl=pl.next;
  }
  while(ps!=null){
   lenB++;
   ps=ps.next;
  }
  //完成两个while pl和ps值为空了
  pl=headA;
  ps=headB;
  int count=lenA-lenB;
  if(count<0){
   pl=headB;
   ps=headA;
   count=lenB-lenA;
  }
  while(count!=0){
   pl=pl.next;
   count--;
  }
  //两个引用一直走直到他们相遇
  while(pl != ps){
   ps=ps.next;
   pl=pl.next;
  }
  return  ps;
 }
}
*/
/*
给定一个链表，判断链表中是否有环

public class Solution {
    public boolean hasCycle(ListNode head) {
        if(head==null)return false;
        ListNode fast=head;
        ListNode slow=head;
        while(fast!=null&&fast.next!=null){
            fast=fast.next.next;
            slow=slow.next;
        if(slow==fast){
            return true;
        }
        }
        return false;
    }
}

给定一个链表，返回链表开始入环的第一个节点。如果链表无环，则返回NULL
public class Solution {
    public ListNode detectCycle(ListNode head) {
        ListNode fast=head;
        ListNode slow=head;
        while(fast!=null&&fast.next!=null){
            fast=fast.next.next;
            slow=slow.next;
        if(slow==fast){
            break;//如果有环退循环进下一步
        }
        }
        if(fast==null||fast.next==null){
            return null;//无环
        }
        //设到环头节点为x，环长为y，相遇结点到头节点为d，由fast=2slow
        //可知当slow从头走，fast从相遇位置走两者到头节点距离一样
        //如果环为小环，fast多转几圈一样的
        slow=head;
        while(slow!=fast){
          slow=slow.next;
          fast=fast.next;
        }


    return slow;
}
}
*/

 /*链表的回文结构
 public class PalindromeList {
    public boolean chkPalindrome(ListNode head) {
         if(head==null)return true;
        ListNode fast=head;
        ListNode slow=head;
        while(fast!=null&&fast.next!=null){
                fast=fast.next.next;
                slow=slow.next;
        }//翻转
        ListNode cur=slow.next;
        while(cur!=null){
                ListNode curN=cur.next;
                cur.next=slow;
                slow=cur;
                cur=curN;
        }
        //没相遇
        while(head!=slow){
            if(head.val!=slow.val){
                return false;
            }//一定是值相同才能true
            if(head.next==slow){
                return true;
            }
            head=head.next;
            slow=slow.next;
        }
        return true;
        }

    }
 */
 /*以给定值x为基准将链表分割成两部分，所有小于x的结点排在大于或等于x的结点之前
public class Partition {
 public ListNode partition(ListNode pHead, int x) {
  ListNode as=null;
  ListNode ae=null;
  ListNode bs=null;
  ListNode be=null;
  ListNode cur=pHead;
  if(cur==null)return cur;
  while(cur!=null)
  {
   if(cur.val<x){
    if(as==null){
     as=ae=cur;
    }else{
     ae.next=cur;
     ae=ae.next;
    }
    cur=cur.next;
   }else{
    if(bs==null){
     bs=be=cur;
    }else{
     be.next=cur;
     be=be.next;
    }
    cur=cur.next;
   }
  }
  if(as==null){
   return bs;
  }
  ae.next=bs;
  if(be!=null){
   be.next=null;
  }

  return as;
 }
}
*/
/*合并两个有序链表
  class Solution {
   public ListNode mergeTwoLists(ListNode list1, ListNode list2) {
  if(list1==null){
   return list2;
  }
  if(list2==null){
   return list1;
  }
  ListNode list3=new ListNode(-1);
  ListNode temp=list3;
  while(list1!=null&&list2!=null){
   if(list1.val<list2.val){
    temp.next=list1;
    list1=list1.next;
   }else{
    temp.next=list2;
    list2=list2.next;
   }
   temp=temp.next;
  }
  if(list2==null){
   temp.next=list1;
  }
  if(list1==null){
   temp.next=list2;
  }
  return list3.next;
 }

}*/
 /*删除目标元素
 class Solution {
    public ListNode removeElements(ListNode head, int val) {
        while (head != null && head.val == val) {
        head = head.next;
    }
        if(head==null)return head;
        ListNode code=head.next;
        ListNode cur=head;
        while(code!=null){
            if(code.val==val){
                cur.next=code.next;
                code=code.next;
            }else{
                cur=code;
                code=code.next;
            }
        }
        return head;
    }

}
 */
 /*反转链表以第二个元素开始，把其移到head之前
 class Solution {
    public ListNode reverseList(ListNode head) {
        if(head==null)return head;
        ListNode code=head.next;
        head.next=null;！！
        while(code!=null){
            ListNode codeN=code.next;
            code.next=head;
            head=code;
            code=codeN;
        }

        return head;
    }
}
 */
 /* 输出倒数第几个元素
 class Solution {
     public int daoshu(ListNode head, int key) {
         if (head == null) return head;
         ListNode fast=head;
         ListNode slow=head;
         int count=0;
         while(count!=key-1){
            fast=fast.next;
            count++;
         }fast先走k-，然后slow开始走，fast到最后结点slow到倒数第几个节点
         while(fast.next!=null){
             fast=fast.next;
             slow=slow.next;
         }
         return slow;
     }
 }*/
/*返回一个链表的中间值
    class Solution {
    public ListNode middleNode(ListNode head) {
        if(head==null)return head;
        ListNode fast=head;
        ListNode slow=head;
        while(fast!=null&&fast.next!=null)不能交换顺序，一口气走两个{
            fast=fast.next.next;
            slow=slow.next;
        }

        return slow;
    }
}
*/
   /*纸牌
    class Card {
        public int rank;
        public String color;
        @Override
        public String toString() {
            return "Card{" + color + rank + '\'' + '}';
        }
    }

    class Doem {
        static  String[] color = {"♥", "♠", "♦", "♣"};
        public static List<Card> buyDeck() {
            List<Card> deck = new ArrayList<>(52);
            for (int i = 0; i < 4; i++) {
                for (int j = 1; j <= 13; j++) {
                    String color1 = color[i];
                    int rank = j;
                    Card card = new Card();
                    card.rank = rank;
                    card.color = color1;
                    deck.add(card);
                }
            }
            return deck;
        }

        public static void swap(List<Card> deck, int i, int j) {
            Card t = deck.get(i);//获取i下标元素
            deck.set(i, deck.get(j));//把i下标元素改为j下标元素
            deck.set(j, t);//把j下标元素改为i下标元素
        }

        public static void shuffle(List<Card> deck) {
            Random random = new Random(20190905);
            for (int i = deck.size() - 1; i > 0; i--) {
                int r = random.nextInt(i);
                swap(deck, i, r);//随机调换i和r下标元素
            }

        }
    }
    public class zuoye {
        public static void main(String[] args) {
            List<Card> deck = Doem.buyDeck();
            System.out.println("刚买回来的牌:");
            System.out.println(deck);
            shuffle(deck);
            System.out.println("洗过的牌:");
            System.out.println(deck);
            List<List<Card>> hands = new ArrayList<>();//二维数组，hands1，2，3及每人对应的一组数
            hands.add(new ArrayList<>());
            hands.add(new ArrayList<>());
            hands.add(new ArrayList<>());
            for (int i = 0; i < 5; i++) {
                for (int j = 0; j < 3; j++) {
                    hands.get(j).add(deck.remove(0));//从 deck（假设为一个已定义的卡牌列表）中移除并获取第一个元素（deck.remove(0)），
                    // 然后将其添加到 hands 的第 j 个子列表中。
                }
            }
            System.out.println("剩余的牌:");
            System.out.println(deck);
            System.out.println("A 手中的牌:");
            System.out.println(hands.get(0));
            System.out.println("B 手中的牌:");
            System.out.println(hands.get(1));
            System.out.println("C 手中的牌:");
            System.out.println(hands.get(2));
        }
    }

    */
   /*class People{
       String name;
       public People(String name) {
           this.name = name;
       }
       public void eat(){
           System.out.println(name + "正在吃饭");
       }
   }
class Meinv extends People{
    Meinv(String name){
        super(name);
    }
    public void eat() {
        System.out.println(name + "正在吃饭");
    }
}
class Shuaige extends People{
    Shuaige(String name){
        super(name);
    }
    public void eat() {
        System.out.println(name + "正在吃饭");
    }
}
public class zuoye {
    //编译器此时不知道调用美女类还是帅哥类的eat方法，等形参a确定后才能知道到底调用那个方法，注意！！！此时返回值类型必须为父类类型
    public static void eat(People a){
        a.eat();
    }
    public static void main(String[] args) {
        Shuaige shuaige=new Shuaige("小帅");
        Meinv meinv=new Meinv("小美");
        eat(shuaige);
        eat(meinv);
    }
}
    /*public static void main(String[] args) {
        int sum=0;
        int i=0;
        do {
            sum+=i;
            i++;
        }
            while(i<=5);
        System.out.println(sum);
    }
}
    /*public static void main(String[] args) {
        int sum = 0;
        for (int i = 1; i <= 99; i++) {
            if (i % 2 == 0) {
            } else {
                sum += i;
            }
        }
        System.out.println(sum);
    }
}
    /*class Base {
        private int x;
        private int y;
        public Base(int x, int y) {
            this.x = x;
            this.y = y;
        }
        public int getX() {
            return x;
        }
        public int getY() {
            return y;
        }
    }
    class Sub extends Base {
       private int z;
        public Sub(int x, int y, int z) {
            super(x, y);
            this.z = z;
        }
        public int getZ() {
            return z;
        }
        public int calculate() {
            return super.getX() * super.getY() * this.getZ();
        }
    }
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int x = scanner.nextInt();
            int y = scanner.nextInt();
            int z = scanner.nextInt();
            Sub sub = new Sub(x, y, z);
            System.out.println(sub.calculate());
        }
    }

}
    /*public static Boolean fun(int[] array){
        int count=0;
        for (int i = 0; i < array.length; i++) {
            if (array[i] % 2 != 0) {
                count++;
                return true;
            } else {
                count = 0;
            }
        }
        return false;
    }
    public static void main(String[] args) {
        int[] array={1,2,3,3,3,4,4,5};
        System.out.println(fun(array));
    }

}
  /*public static int fun(int[] array){
      int tmp=0;
        Arrays.sort(array);
        tmp=array.length/2;
      return array[tmp];
  }
    public static void main(String[] args) {
       int[]array={2,2,3,3,3};
        System.out.println(fun(array));
    }

}
   /*异或，筛选出单独的一个，两个相同的数异或为0
    public static int fun(int[] array){
        int tmp=0;
        for (int i = 0; i < array.length; i++) {
            tmp ^= array[i];
        }
        return tmp;
    }
    public static void main(String[] args) {
        int []array={1,1,4,4,6,7,7};
        int tmp=fun(array);
        System.out.println(tmp);
    }


}
    /*public static int[] fun(int[] array,int target){
        int[] tmp=new int[]{-1,-1};
        for (int i = 0; i < array.length; i++) {
            for (int j = i+1; j <array.length ; j++) {
                if(array[i]+array[j]==target){
                    tmp[0]=i;
                    tmp[1]=j;
                }
            }
        }
        return tmp;
    }
    public static void main(String[] args) {
        int []array={2,5,3,7,8};
        int[] tmp=fun(array,12);
        System.out.println(Arrays.toString(tmp));
    }
}
    /*冒泡排序 选取一个元素与所有的比较进行排序
    public static void bubbleSort(int[] arr) {

        for (int i = 0; i < arr.length; i++) {
            for (int j = 1; j < arr.length - i; j++) {
                if (arr[j - 1] > arr[j]) {
                    int tmp = arr[j - 1];
                    arr[j - 1] = arr[j];
                    arr[j] = tmp;
                }
            }
        }
    }
    public static void main(String[] args) {
         int[] arr={1,5,4,8};
        bubbleSort(arr);
        System.out.println(Arrays.toString(arr));
    }


}
    /*二分查找  对半查找比较
    public static int fun(int[] array,int find){
        int left=0;
        int right=array.length-1;
          while(left<=right)
          {
              int mid = (left + right) / 2;
               if (find < array[mid]) {
                  // 去左侧区间找
                 right = mid - 1;
               } else if (find > array[mid]){
               // 去右侧区间找
                 left = mid + 1;
              } else {
               //就是中间数
                   return mid;
                }
            }
        return 0;
    }
    public static void main(String[] args) {
        int[] array={1,2,3,4,5,6,7};
        int x=fun(array,5);
        System.out.println(x);
    }
}
    /*public static void fun(int[] array){
        int left=0;//下标
        int right=array.length-1;
        while(left<right){
            while(left<right&& array[left]%2!=0){
                left++;
            }
            while(left<right && array[right]%2==0){
                right--;
            }
            fun1(array,left,right);
        }
    }
    public static void fun1(int []array,int i,int j){
        int tmp=array[i];
        array[i]=array[j];
        array[j]=tmp;
    }
    public static void main(String[] args) {
        int[]array={1,2,3,4,5,6};
        fun(array);
        System.out.println(Arrays.toString(array));
    }
}
    /*public static void transform(int[] array){
        for (int i = 0; i < array.length; i++) {
            array[i]=array[i]*2;

        }
    }
    public static void main(String[] args) {
        int[] array={1,2,3};
        transform(array);
        System.out.println(Arrays.toString(array));
    }
}

    /*=
     public static int Max(int a,int b){
        if (a>b){
            return a;
        }else{
            return b;
        }
    }
    public static double Max(double x,double y,double z){
        return (x>y?x:y)>z?(x>y?x:y):z;
    }

    public static void main(String[] args) {
        System.out.println(Max(5,9));
        System.out.println(Max(5.2,8.9 ,1.2));
    }
}

   /*public static int Sum(int a,int b){
       return a+b;
   }
    public static double Sum(double x,double y,double z){
       return x+y+z;
    }

    public static void main(String[] args) {
        System.out.println(Sum(4,5));
        System.out.println(Sum(1.6,5.2,3.1));
    }
}

    /*public static int Max2(int x,int y) {
        if(x>y){
            return x;
        }else{
            return y;
        }
    }
    public static int Max3(int x,int y,int z){
       return Max2(Max2(x,y),z) ;
    }
    public static void main(String[] args) {
        System.out.println(Max2(4,6));
        System.out.println(Max3(6,4,9));
    }
}
    /*public static void main(String[] args) {
        double sum=0;
        int flg=1;
        for (int i = 1; i <=100; i++) {
            sum+=1.0/i*flg;
            flg=-flg;
        }
        System.out.println(sum);
    }
}
   /* public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        for (int i = 0; i <=n; i++) {
            int count=1;
            int tmp=i;
            int sum=0;
            while(tmp/10!=0){
                count++;
                tmp=tmp/10;
            }
            tmp=i;
            while(tmp!=0)
            {
                sum+=Math.pow(tmp%10,count);
                tmp=tmp/10;
            }
            if(sum==i)
                System.out.println(i);
        }
    }



}
   /* public static void main(String[] args) {
     int sum=0;
        for (int i = 1; i <=100 ; i++) {
            if(i/10==9){
                sum++;
            }if(i%10==9)
            {
                sum++;
            }
        }
        System.out.println(sum);
    }
   */
